<%
'#################################################################################
'## UnWritten Open Source Blog Engine
'#################################################################################
'## Copyright (C) 2008 Luigi Violin
'##
'## This program is free software: you can redistribute it and/or modify
'## it under the terms of the GNU General Public License as published by
'## the Free Software Foundation, either version 2 of the License, or
'## (at your option) any later version.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program.  If not, see <http://www.gnu.org/licenses/>.
'##
'## You can obtain support from our forums at:
'##     <http://www.unwrittenblog.com/forums/>
'## Contact the author directly:
'##     <zaamit@hotmail.com/>
'##
'#################################################################################
%>
<!--#include virtual="/includes/lang/en.asp"-->
<!--#include file="main-content.asp"-->
<%

function gen_search()
randomize()
gen_search = ""
gen_search = gen_search & "<form id=""search_form"" method=""get"" action=""/search.asp"">"
gen_search = gen_search & "<input id=""search_string"" type=""text"" size=""30"" name=""ss"" onKeyUp=""document.getElementById('quicksearch_results').style.display='block';loadSP('" & request.ServerVariables("HTTP_HOST") & "',this.value,'quicksearch_results',5," & rnd() & ");"" autocomplete=""off"" />"
gen_search = gen_search & " <input type=""submit"" value=""Search"" id=""search_submit"" />"
gen_search = gen_search & "</form>"
gen_search = gen_search & "<div id=""quicksearch_results"" onmouseout=""this.style.display='none';"" onmousemove=""this.style.display='block';""></div>"
end function

function gen_welcome()
gen_welcome = ""
logged = initLogIn
gen_welcome = gen_welcome & lc("welcome") & " <strong><a href=""/profile.asp"">" & Session("u_name") & "</a></strong>"
if logged then
	if Session("u_level") = 10 then
		gen_welcome = gen_welcome & " | <a href=""/admin/"">Control Panel</a>"
	end if
	gen_welcome = gen_welcome & " | <a href=""/logout.asp"">Logout</a>"
	else
	  gen_welcome = gen_welcome & " | <a href=""/login.asp"">Login</a> | <a href=""/signup.asp"">Sign up</a>"
end if
end function

function gen_login()
gen_login = ""
gen_login = gen_login & "Please login using the form below. If you don't already have an account, you can <a href=""/signup.asp"">create one now</a>.<br /><br /><br />"
gen_login = gen_login & "<form id=""login_form"" method=""post"" action=""/login.asp"" class=""boxed_form"">" & vbcrlf
gen_login = gen_login & "<label>Username</label><br /><input name=""n"" id=""n"" type=""text"" size=""30"" class=""form_field_box"" value=""" & request.form("n") & """ tabindex=""1"" /><br /><br />" & vbcrlf
gen_login = gen_login & "<label>Password</label> <a href=""/lost-password.asp"">(Forgot?)</a><br /><input name=""p"" id=""p"" type=""password"" size=""30"" class=""form_field_box"" tabindex=""2"" /><br /><br />" & vbcrlf
gen_login = gen_login & "<input type=""hidden"" name=""return_url"" value=""" & return_url & """>" & vbcrlf
gen_login = gen_login & "<div class=""form_buttons"">"
gen_login = gen_login & "<p align=""left""><input type=""checkbox"" name=""remember_me"" tabindex=""3"" />&nbsp;Remember me</p>"
gen_login = gen_login & "<input type=""submit"" value=""Login"" class=""form_button"" tabindex=""4"" /></div>" & vbcrlf
gen_login = gen_login & "</form>" & vbcrlf
end function

function gen_header()
gen_header = ""
gen_header = gen_header & "<title>" & strip_html(zb_name) & " - " & page(title) & "</title>" & vbcrlf
gen_header = gen_header & "<meta name=""description"" content=""" & zb_description & """ />" & vbcrlf
gen_header = gen_header & "<meta name=""keywords"" content=""" & zb_keywords & """ />" & vbcrlf
gen_header = gen_header & "<meta name=""generator"" content=""UnWritten Open Source Blog Engine"" />" & vbcrlf
gen_header = gen_header & "<link type=""text/css"" rel=""stylesheet"" href=""/themes/" & zb_theme & "/style.css"" />" & vbcrlf
gen_header = gen_header & "<!-- TinyMCE --><script type=""text/javascript"" src=""/includes/modules/tiny_mce/tiny_mce.js""></script><script type=""text/javascript"">tinyMCE.init({mode : ""textareas"",theme : ""simple""});</script><!-- /TinyMCE -->" & vbcrlf
gen_header = gen_header & "<script type=""text/javascript"" src=""/js/tabber-init.js""></script>" & vbcrlf
gen_header = gen_header & "<script type=""text/javascript"" src=""/js/tabber.js""></script>" & vbcrlf
gen_header = gen_header & "<link type=""text/css"" rel=""stylesheet"" href=""/js/tabber.css"" />" & vbcrlf
gen_header = gen_header & "<script type=""text/javascript"" src=""/js/ajax.js""></script>" & vbcrlf
end function

function gen_footer()
	gen_footer =""
	gen_footer = gen_footer & zb_copyright
	gen_footer = gen_footer & " // Powered by <a href=""http://www.unwrittenblog.com"">UnWritten - OSBE</a>."
end function

function gen_contactform()
	gen_contactform = "<br />"
	if request.QueryString("msg") <> "" then
	gen_contactform = gen_contactform & "<div class=""info"">" & request.QueryString("msg") & "</div>"	
	end if
	gen_contactform = gen_contactform & "<form id=""email_form"" method=""post"" action=""/includes/dosendemail.asp"">"
	gen_contactform = gen_contactform & "<table width=""500"">"
	gen_contactform = gen_contactform & "<tr><td width=""50""><strong>Name:</strong></td><td width=""200""><input type=""text"" name=""name""></td>"
	gen_contactform = gen_contactform & "<td width=""50""><strong>E-Mail:</strong><td width=""200""><input type=""text"" name=""email""></td></tr>"
gen_contactform = gen_contactform & "<tr><td width=""50""><strong>Website:</strong><td width=""200""><input type=""text"" name=""website""></td>"
	gen_contactform = gen_contactform & "<td width=""50""><strong>Subject:</strong><td width=""200""><input type=""text"" name=""subject""></td></tr></table><br />"
	gen_contactform = gen_contactform & "<strong>Message:</strong><br><textarea name=""message"" cols=""60""></textarea>"
	gen_contactform = gen_contactform & "<br /><input type=""submit"" value=""Send"" class=""form_button"" />"
	gen_contactform = gen_contactform & "</form>"
end function

function gen_signup()
	gen_signup = "<form id=""signup_form"" method=""post"" action=""signup.asp"" class=""boxed_form"">"
	gen_signup = gen_signup & "<label>Name</label><br><input type=""text"" name=""n"" class=""form_field_box"" value=""" & request.form("n") & """><br><br>"
	gen_signup = gen_signup & "<label>Password</label><br><input type=""password"" name=""p"" class=""form_field_box""><br><br>"
	gen_signup = gen_signup & "<label>E-Mail</label><br><input type=""text"" name=""e"" class=""form_field_box"" value=""" & request.form("e") & """><br><br>"
	gen_signup = gen_signup & "<div class=""form_buttons""><input type=""submit"" value=""Sign Me Up"" class=""form_button"" tabindex=""3"" /></div>" & vbcrlf
	gen_signup = gen_signup & "</form>"
end function
%>